<?php

namespace app\api\controller;

use app\common\controller\Api;

/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];
    protected $table = 'fa_test';

    protected $relation = ['category'];

    /**
     * 首页
     *
     */
    public function add()
    {

        $tab = [
            "table" => "",
            "list" => [
                [
                    "title" => "单选框组",
                    "field" => "radio_1562501765000_34621",
                    "attr" => "ENUM",
                    "icon" => "icon-radio-active",
                    "filter-render" => [
                        "name" => "radio",
                        "inline" => true,
                        "defaultValue" => "",
                        "showLabel" => false,
                        "required" => false,
                        "width" => "",
                        "remote" => false,
                        "remoteOptions" => [],
                        "props" => [
                            "value" => "value",
                            "label" => "label"
                        ],
                        "remoteFunc" => "func_1562501765000_34621",
                        "disabled" => false
                    ],
                    "filters" => [
                        [
                            "value" => "选项1",
                            "label" => "选项1"
                        ],
                        [
                            "value" => "选项2",
                            "label" => "选项2"
                        ],
                        [
                            "value" => "选项3",
                            "label" => "选项3"
                        ]
                    ],
                    "key" => "1562501765000_34621",
                    "model" => "radio_1562501765000_34621",
                    "rules" => []
                ],

                [
                    "title" => "单选框组",
                    "field" => "radio_1562501765000_34621",
                    "attr" => "ENUM",
                    "icon" => "icon-radio-active",
                    "filter-render" => [
                        "name" => "radio",
                        "inline" => true,
                        "defaultValue" => "",
                        "showLabel" => false,
                        "required" => false,
                        "width" => "",
                        "remote" => false,
                        "remoteOptions" => [],
                        "props" => [
                            "value" => "value",
                            "label" => "label"
                        ],
                        "remoteFunc" => "func_1562501765000_34621",
                        "disabled" => false
                    ],
                    "filters" => [
                        [
                            "value" => "选项1",
                            "label" => "选项1"
                        ],
                        [
                            "value" => "选项2",
                            "label" => "选项2"
                        ],
                        [
                            "value" => "选项3",
                            "label" => "选项3"
                        ]
                    ],
                    "key" => "1562501765000_34621",
                    "model" => "radio_1562501765000_34621",
                    "rules" => []
                ]
            ],
            "config" => [
                "labelWidth" => 100,
                "labelPosition" => "right",
                "size" => "small"
            ]
        ];
        $this->success('请求成功',$tab);
    }
}
